package riceSystem.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import riceSystem.dao.DaoTemplateInterface;
import riceSystem.entity.Classification;
import riceSystem.exception.RunException;
import riceSystem.service.ServiceTemplateInterface;
@Component("classificationService")
public class ClassificationServiceImpl implements ServiceTemplateInterface<Classification> {

	private DaoTemplateInterface<Classification> classificationDao;
	
	public DaoTemplateInterface<Classification> getClassificationDao() {
		return classificationDao;
	}
	@Resource(name="classificationDao")
	public void setClassificationDao(
			DaoTemplateInterface<Classification> classificationDao) {
		this.classificationDao = classificationDao;
	}

	public void add(Classification t) throws RunException {
		classificationDao.save(t);
	}

	public void removeById(long id) throws RunException {
		classificationDao.deleteById(id);
	}

	public void remove(Classification t) throws RunException {
		classificationDao.delete(t);
	}

	public long update(Classification t) throws RunException {
		return classificationDao.update(t);
	}

	public Classification getById(long id) throws RunException {
		return classificationDao.loadById(id);
	}

	public List<Classification> getAll() throws RunException {
		return classificationDao.loadAll();
	}
}
